package cn.wangyazhu.SettlementRecord.service;

import cn.wangyazhu.SettlementRecord.model.SettlementRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface SettlementRecordRepository extends JpaRepository<SettlementRecord, Long> {
    @Query("from SettlementRecord s where s.username=:username")
    List<SettlementRecord> findByUsername(@Param("username") String username);

    @Query("from SettlementRecord s where s.id=:id")
    SettlementRecord findSrById(@Param("id") Long id);

    void deleteById(Long id);
}
